package com.androwit.engine.mapping.converter.str;

import com.androwit.engine.mapping.Converter;

public class IntegerConverter implements Converter<Integer, String> {

	@Override
	public Integer fromConverted(String value) throws Exception {
		if (value == null || value.length() == 0)
			return 0;
		return Integer.parseInt(value);
	}

	@Override
	public String convert(Integer value) throws Exception {
		return value.toString();
	}

}
